
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>文字2</title>
</head>
<body >
<canvas id="canvas" style="display: block;margin: 0 auto;border: 1px solid #aaa">
    您的浏览器不支持canvas
</canvas>
<script>
    window.onload=function(){
        var canvas=document.getElementById("canvas");
        canvas.width=800;
        canvas.height=800;
        var context=canvas.getContext("2d");


        context.fillStyle="#058";
        context.font="bold 120px Arial";

        context.textAlign="center";
        context.textBaseline="middle";

        context.shadowColor="gray";
        context.shadowOffsetX=10;
        context.shadowOffsetY=10;
        context.shadowBlur=5;

        context.fillText("CANVAS", canvas.width/2,canvas.height/2);
    }
</script>
</body>
</html>